package base.reflect;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

public class PropertiesReflectDemo {


    public static void main(String[] args) throws IOException, ClassNotFoundException {
        getPropertiesClassName();
    }


    public static void getPropertiesClassName() throws IOException, ClassNotFoundException {


        String filePath=".\\src\\base\\reflect\\pci.properties";
        String filePath2="E:\\\\file\\\\javaFile\\\\practiceDemo\\\\src\\\\base\\\\reflect\\\\pci.properties";
//        String filePath3="\pci.properties";

//        File configFile=new File("E:\\file\\javaFile\\practiceDemo\\src\\base\\reflect\\pci.properties");
        // base/reflect/pci.properties
//        File configFile=new File(".\\pci.properties");
        File configFile=new File(filePath);

        Properties properties=new Properties();

        FileInputStream fis=new FileInputStream(configFile);

        properties.load(fis);

        for (int i=0;i<properties.size();i++){
            String pciName=properties.getProperty("pci"+(i+1));
            System.out.println(pciName);
            Class clazz=Class.forName(pciName);

        }
        fis.close();

    }

}
